home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 2 / CU Amiga Magazine's Super CD-ROM 02 (1996)(EMAP Images)(GB)[!][issue 1996-04].iso / magazine / amiga_e / amigae.july.archive / 000097_crash!cup.port….com!Politikill_Wed, 28 Jul 93 15:50:52 PST.msg < prev    next >
Text File  |  1993-08-31  |  3KB  |  84 lines

  1. Received: by bkhouse.cts.com (V1.16/Amiga)
  2.     id AA00000; Wed, 28 Jul 93 15:50:52 PST
  3. Received: from nova.unix.portal.com by crash.cts.com with smtp
  4.     (Smail3.1.28.1 #15) id m0oLJr6-0000RyC; Wed, 28 Jul 93 15:20 PDT
  5. Received: by nova.unix.portal.com (5.65b/4.1 1.386) 
  6.     id AA05170; Wed, 28 Jul 93 15:24:12 -0700
  7. Received: from hobo  by portal.unix.portal.com (1.689) 
  8.     id AA02180; Wed, 28 Jul 93 15:24:09 -0700
  9. Received: by hobo.corp.portal.com (4.1/4.0.3 1.68) 
  10.     id AA05090; Wed, 28 Jul 93 15:24:08 PDT
  11. Return-Path: <Politikill@cup.portal.com>
  12. Lines: 65
  13. Date: Wed, 28 Jul 93 15:24:06 PDT
  14. Message-Id: <9307281524.1.17100@cup.portal.com>
  15. X-Origin: The Portal System (TM)
  16. From: Politikill@cup.portal.com
  17. To: AmigaE@bkhouse.cts.com
  18. Subject: MidStr
  19.  
  20. Hi everyone! 
  21.     I figured out one main problem in my program (where I thought memory was
  22. being munged up, I hadjust forgotten to define a variable as a string for use
  23. in StringF()!) but have run into another one.
  24.  
  25.     I can't get MidStr() to work right.  It is reading it from the starting
  26. point right, but I can't get it to stop! I am trying to get a version string
  27. pulled out of a buffer I am getting from Read(). Before vtst was defined as a
  28. string, it was working somewhat well (I was getting what I wanted), but I am
  29. not sure whether it was stoping where I wanted. What I need is the original
  30. version string, with the revision number bumped up by one.
  31.  
  32. =======================================================================
  33.  
  34. PROC findver(pos) /* pos is found in the prior proc */
  35.   DEF endpos,
  36.       vers,
  37.       per,
  38.       vn,
  39.       vp,
  40.       vns,
  41.       nvers,
  42.       rvers,
  43.       vtst[80]:STRING
  44.  
  45.   endpos:=InStr(filbuf,'\n',pos) /* finding then end of the line */
  46.   MidStr(vers,filbuf,pos,endpos-pos)
  47.  
  48.   per:=InStr(vers,'.',0)
  49.   MidStr(vn,vers,per-2,2)
  50.   vp:=Val(vn,NIL)
  51.   MidStr(vns,vers,per+1,3)
  52.   rvers:=Val(vns,NIL)
  53.   rvers:=rvers+1
  54.  
  55.   /* finding the version/revision and bumping it up by one */
  56.  
  57.   MidStr(nvers,vers,0,per-2) 
  58.  
  59.   /* getting everything prior to the version/revision */
  60.  
  61.   StringF(vtst,'\s \d.\d',nvers,vp,rvers)
  62.  
  63. ENDPROC vtst
  64.  
  65. ========================================================================
  66.  
  67.     If you have some other, better, or even working way of doing this, please
  68. let me know, otherwise, can someone help me FIX this?
  69.  
  70.  / / /
  71. /_/_/iZ
  72.  
  73.  
  74. MODULE 'WiZkId'
  75. PROC main()
  76.   wizkid.inetaddress:='Politkill@cup.portal.com'
  77.   wizkid.realname:='Jeffrey J Peden ]['
  78. ENDPROC
  79.  
  80.  
  81.  
  82.  
  83. *-- GammaTag Version 2.8 --*
  84. *-- SCOTTY: I think you gave me too much time, Captain.